//
//  AdmissionsCardHeadView.m
//  CoachsBook
//
//  Created by MaBookPro on 2022/8/18.
//

#import "AdmissionsCardHeadView.h"

@implementation AdmissionsCardHeadView


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self CreateUI];
    }
    return self;
}
-(void)CreateUI{


    UIView *backV = [[UIView alloc]initWithFrame:CGRectMake(0, 0, APPwidth, 240)];
    backV.backgroundColor = [UIColor whiteColor];
    [self addSubview:backV];

    
    
    UIImageView *circleimgv = [[UIImageView alloc]initWithFrame:CGRectMake(15, 20, 40, 40)];
    circleimgv.backgroundColor = [UIColor grayColor];
    circleimgv.image = [UIImage imageNamed:@"headicon"];
    circleimgv.layer.cornerRadius = 40/2;
    circleimgv.userInteractionEnabled = YES;
    [self addSubview:circleimgv];

    UILabel *nameLab = [[UILabel alloc]initWithFrame:CGRectMake(circleimgv.frame.size.width+circleimgv.frame.origin.x+15,  20, 55, 20)];
    nameLab.text = @"肯德基";
    nameLab.textColor = [UIColor blackColor];
    nameLab.textAlignment = 0;
    nameLab.font = [UIFont systemFontOfSize:14];
    [backV addSubview:nameLab];
    

    UILabel *schoolLab = [[UILabel alloc]initWithFrame:CGRectMake(nameLab.frame.size.width+nameLab.frame.origin.x+5,  20, 60, 20)];
    schoolLab.text = @"阿牛驾校";
    schoolLab.backgroundColor = rgba(234, 249, 242, 1);
    schoolLab.textColor = rgba(38, 194, 126, 1);
    schoolLab.textAlignment = 1;
    schoolLab.layer.cornerRadius = 10;
    schoolLab.layer.masksToBounds = YES;
    schoolLab.font = [UIFont systemFontOfSize:12];
    [backV addSubview:schoolLab];
    

    UILabel *timeLab = [[UILabel alloc]initWithFrame:CGRectMake(circleimgv.frame.size.width+circleimgv.frame.origin.x+15,  nameLab.frame.size.height + nameLab.frame.origin.y+10, APPwidth/2, 15)];
    timeLab.text = @"入行时间:2018-03-22";
    timeLab.textColor = [UIColor blackColor];
    timeLab.textAlignment = 0;
    timeLab.font = [UIFont systemFontOfSize:12];
    [backV addSubview:timeLab];
    
    
    
    UIButton *callPhoneBtn = [[UIButton alloc]initWithFrame:CGRectMake(0, timeLab.frame.size.height+timeLab.frame.origin.y+15, APPwidth, 55)];
    [callPhoneBtn setTitle:@"18684930576" forState:0];
//    [callPhoneBtn setImage:[UIImage imageNamed:@""] forState:0];
    callPhoneBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
    callPhoneBtn.titleEdgeInsets = UIEdgeInsetsMake(0, 20, 0, 0);
    callPhoneBtn.titleLabel.font = [UIFont systemFontOfSize:14];
    [callPhoneBtn setTitleColor:[UIColor blackColor] forState:0];
//    callPhoneBtn.imageEdgeInsets = UIEdgeInsetsMake(0, 15, 0, 20);
//    [callPhoneBtn.imageView setContentMode:UIViewContentModeScaleAspectFit];
//    callPhoneBtn.titleEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 0);
    [backV addSubview:callPhoneBtn];
    UIView *aline = [[UIView alloc]initWithFrame:CGRectMake(0, 1, callPhoneBtn.frame.size.width, 1)];
    aline.backgroundColor = rgba(245, 245, 250, 1);
    [callPhoneBtn addSubview:aline];

    
    
    UIButton *addressBtn = [[UIButton alloc]initWithFrame:CGRectMake(0, callPhoneBtn.frame.size.height+callPhoneBtn.frame.origin.y, APPwidth, 55)];
    [addressBtn setTitle:@"湖南省长沙市岳麓区马来坡路" forState:0];
    [addressBtn setImage:[UIImage imageNamed:@""] forState:0];
    addressBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
    addressBtn.titleEdgeInsets = UIEdgeInsetsMake(0, 20, 0, 0);
    addressBtn.titleLabel.font = [UIFont systemFontOfSize:14];
    [addressBtn setTitleColor:[UIColor blackColor] forState:0];
//    addressBtn.imageEdgeInsets = UIEdgeInsetsMake(10, 13, 7, 62);
//    [addressBtn.imageView setContentMode:UIViewContentModeScaleAspectFit];
//    addressBtn.titleEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 0);
    [backV addSubview:addressBtn];
    UIView *aline1 = [[UIView alloc]initWithFrame:CGRectMake(0, 1, addressBtn.frame.size.width, 1)];
    aline1.backgroundColor = rgba(245, 245, 250, 1);
    [addressBtn addSubview:aline1];

    
    
    
    UIView *line = [[UIView alloc]initWithFrame:CGRectMake(0, addressBtn.frame.size.height+addressBtn.frame.origin.y+5, APPwidth, 10)];
    line.backgroundColor = rgba(245, 245, 250, 1);
    [backV addSubview:line];

    
    UIView *Line = [[UIView alloc]initWithFrame:CGRectMake(15, line.frame.size.height+line.frame.origin.y+15, 3, 15)];
    Line.backgroundColor = rgba(22, 120, 255, 1);
    Line.layer.cornerRadius = 2;
    [backV addSubview:Line];
    UILabel *classCoachPickUpLab = [[UILabel alloc]initWithFrame:CGRectMake(Line.frame.size.width+Line.frame.origin.x+5,  line.frame.size.height+line.frame.origin.y+15, 70, 15)];
    classCoachPickUpLab.text = @"班型";
    classCoachPickUpLab.textColor = [UIColor blackColor];
    classCoachPickUpLab.textAlignment = 0;
    classCoachPickUpLab.font = [UIFont systemFontOfSize:16 weight:bold];
    [backV addSubview:classCoachPickUpLab];


    UIButton *addBtn = [[UIButton alloc]initWithFrame:CGRectMake(backV.frame.size.width - 60, line.frame.size.height+line.frame.origin.y+15, 40, 15)];
    [addBtn setTitle:@"新增" forState:0];
    [addBtn setImage:[UIImage imageNamed:@""] forState:0];
    addBtn.titleLabel.textAlignment = 2;
    addBtn.titleLabel.font = [UIFont systemFontOfSize:14];
    [addBtn setTitleColor:[UIColor blueColor] forState:0];
    addBtn.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 10);
    [addBtn.imageView setContentMode:UIViewContentModeScaleAspectFit];
    addBtn.titleEdgeInsets = UIEdgeInsetsMake(0, 10, 0, 0);
    [backV addSubview:addBtn];


}

@end
